package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.domain.db.AnalysisByDay;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {
    @Select("SELECT * FROM tb_analysis_by_day WHERE record_date =#{date} ")
    AnalysisByDay findByDateTime(String date);

    @Select("SELECT SUM(num_registered) FROM tb_analysis_by_day")
    Long findCountSumRegister();

    @Select("SELECT SUM(num_active) FROM tb_analysis_by_day WHERE record_date BETWEEN #{date} AND #{today}")
    Long findCountSubActive(@Param("date")String date ,@Param("today") String today);
}